import BaseLayout from "../../layouts/BaseLayout.vue";
import Login from "../../views/login/index.vue";

export default [
  {
    path: "/",
    redirect: "/workSpace",
  },
  {
    path: "/login",
    component: Login,
    meta: { title: "登录页面" },
  },
  {
    path: "/workspace",
    redirect: "/workspace/console",
    component: BaseLayout,
    meta: { title: "工作空间" },
    children: [
      {
        path: "/workspace/console",
        name: "Workbench",
        component: () => import("../../views/workSpace/console/index.vue"),
        meta: {
          title: "控制台",
          requireAuth: true,
          affix: true,
          closable: false,
        },
      },
    ],
  },
  {
    path: "/error",
    component: BaseLayout,
    meta: { title: "错误页面" },
    children: [
      {
        path: "/error/401",
        component: () => import("../../views/error/401.vue"),
        meta: { title: "401" },
      },
      {
        path: "/error/403",
        component: () => import("../../views/error/403.vue"),
        meta: { title: "403" },
      },
      {
        path: "/error/404",
        component: () => import("../../views/error/404.vue"),
        meta: { title: "404" },
      },
      {
        path: "/error/500",
        component: () => import("../../views/error/500.vue"),
        meta: { title: "500" },
      },
    ],
  },
  {
    path: "/items",
    component: BaseLayout,
    meta: { title: "信息档案" },
    children: [
      {
        path: "/items/user",
        component: () => import("../../views/items/user/index.vue"),
        meta: { title: "账号档案", requireAuth: true },
      },

      {
        path: "/items/goods",
        component: () => import("../../views/items/goods/index.vue"),
        meta: { title: "商品档案", requireAuth: true },
      },
      {
        path: "/items/goods/views/cls",
        component: () => import("../../views/items/goods/views/cls/index.vue"),
        meta: { title: "商品档案", requireAuth: true },
      },
    ],
  },
  {
    path: "/buyer",
    component: BaseLayout,
    meta: { title: "采购" },
    children: [
      {
        path: "/buyer/storage",
        component: () => import("../../views/buyer/storage/index.vue"),
        meta: { title: "采购入库", requireAuth: true },
      },
    ],
  },
  {
    path: "/stock",
    component: BaseLayout,
    meta: { title: "采购" },
    children: [
      {
        path: "/stock",
        component: () => import("../../views/stock/index.vue"),
        meta: { title: "商品库存", requireAuth: true },
      },
    ],
  },
];
